Skip to content

Implement PIP-OS V7.1.0.8: Complete rewrite with ROM loading, system calls, hardware abstraction, and CI/CD#5

Merged
jbltx merged 8 commits intomasterfrom
copilot/rewrite-repository-for-pip-os
Nov 10, 2025
Merged

Implement PIP-OS V7.1.0.8: Complete rewrite with ROM loading, system calls, hardware abstraction, and CI/CD#5
jbltx merged 8 commits intomasterfrom
copilot/rewrite-repository-for-pip-os

Conversation

Copy link
Contributor

Copilot AI commented Nov 9, 2025

Complete implementation of PIP-OS V7.1.0.8 Personal Information Processor Operating System for ARM-based Pip-Boy devices, replacing the minimal V0.1.0.0 stub.

Core System

Boot Sequence

  • Matrix-style character cascade display during initialization
  • Authentic boot messages: LOADER V1.1, EXEC VERSION 41.10, "64K RAM SYSTEM, 38911 BYTES FREE"
  • Audio sequence framework (power-on beep, data stream, relay clicks, ready chime)

ROM Loading

  • ROM header structure with "ROM1" magic, CRC32 verification
  • Chainloading mechanism at 0x00010000 (64KB ROM space)
  • Holotape support with "ROBCO78" format (Game/Utility/Data types)

System Call Interface
13 syscalls providing display, input, audio, sensor, system, and storage operations:

// Display: 0x01-0x04
int32_t draw_line(int32_t x1, int32_t y1, int32_t x2, int32_t y2);
int32_t draw_text(int32_t x, int32_t y, const char* text, uint32_t size);

// Input: 0x10-0x11
uint32_t read_buttons(void);  // Bitmask: UP|DOWN|LEFT|RIGHT|SELECT
int32_t read_dial(void);

// Audio: 0x20-0x21, Sensors: 0x30, System: 0x40-0x41, Storage: 0x50-0x51

Hardware Abstraction

Power Management

  • Battery monitoring (voltage, percentage, low-battery detection)
  • Four power modes: Active, Idle, Sleep, Deep Sleep
  • Wake-on-interrupt framework
  • ARMv6 compatibility (BCM2835 support without WFI/WFE instructions)

Sensors
Framework for 7 sensor types: RTC, battery, Geiger counter, GPS, accelerometer, temperature, heart rate

Memory Layout

0x00010000-0x0001FFFF : ROM Space (Deitrix)
0x00020000-0x0002FFFF : Application RAM
0x00030000-0x0003FFFF : Graphics Buffer

Documentation

  • API Reference: 13 system calls with usage examples
  • Hardware Guide: Three tiers (BCM2835/2836/2837) with GPIO pin assignments, display/sensor connections, power circuits
  • ROM Development: Header structure, linker scripts, example menu system, build toolchain
  • Contributing: Coding standards, driver development templates, PR workflow
  • Test Documentation: Complete test suite guide with usage and troubleshooting

Build System

Fixed Makefile for gcc-arm-none-eabi 13.2.1, builds 40KB kernel7.img for BCM2835/2836/2837 (ARMv6/ARMv7-A/ARMv8-A).

CI/CD and Testing

GitHub Actions Workflow (.github/workflows/ci.yml):

  • Build and Test Job: Automated builds for BCM2835, BCM2836, BCM2837, unit tests, integration tests, binary size checks, artifact archiving
  • Static Analysis Job: Code formatting checks, TODO/FIXME detection, header guard verification, code structure validation
  • Documentation Check Job: Documentation presence and content validation

Test Suite (tests/):

  • run_tests.sh: Integration test runner with toolchain checks, build verification, file presence validation, binary size limits (9 tests)
  • test_memory.py: Unit tests for kernel memory functions (k_strlen, k_memcmp, k_memcpy, memset)
  • README.md: Comprehensive test documentation with usage instructions, CI/CD details, and troubleshooting

Test Results: 100% pass rate (9/9 integration tests, 4/4 unit tests)

Integration Points

Compatible with Deitrix ROM (64KB at 0x00010000), RETROS-BIOS bootloader chain, and UOS terminal OS.

[!WARNING]

Original prompt

Based on the following development plan, make a PR with the complete rewrite of this repository the implement PIP-OS (from Fallout video games serie).

You can also get help from others repos we develop previously:


PIP-OS Development Plan

Personal Information Processor Operating System v7.1.0.8

RobCo Industries Pip-Boy System Software for ARM Architecture

Executive Summary

PIP-OS is the foundational operating system for all Pip-Boy devices, responsible for hardware initialization, ROM loading, and providing core services to the Deitrix ROM or holotape applications. This implementation targets ARM processors (BCM2835/2836/2837) for wearable Pip-Boy replicas with authentic boot sequences and full functionality.

Version Information

  • Current Version: PIP-OS V7.1.0.8
  • Copyright: 2075 RobCo Ind.
  • Loader Version: LOADER V1.1
  • EXEC Version: 41.10
  • Target Platform: ARM Cortex-A series (Raspberry Pi Zero/2/3/4)

1. System Architecture

1.1 Core Components

Boot Loader Layer

  • Primary Loader: Initial hardware setup and display initialization
  • Matrix Display: Random character cascade during boot
  • Audio System: Boot sequence sound generation
  • Hardware Detection: Identify Pip-Boy model and peripherals
  • ROM Selector: Choose between Deitrix ROM and holotape

Kernel Layer

  • Memory Manager: 64KB RAM management with 38,911 bytes free after init
  • Process Scheduler: Cooperative multitasking for ROM applications
  • Device Manager: Hardware abstraction for sensors and peripherals
  • Interrupt Controller: ARM interrupt handling for real-time events
  • Power Management: Battery monitoring and power saving modes

Service Layer

  • Display Service: Vector graphics rendering engine
  • Input Service: Button, dial, and touch input processing
  • Audio Service: Sound synthesis and playback
  • Sensor Service: Unified interface for all sensors
  • Storage Service: Holotape and ROM access

User Space Interface

  • ROM Loader: Deitrix chainloading mechanism
  • Holotape Runtime: Direct holotape execution environment
  • System Call Interface: Clean API for ROM/holotape programs
  • Memory Map: Protected regions for safe application execution

1.2 Boot Sequence Flow

Power On → Matrix Display → Hardware Check → Memory Init → ROM/Holotape Detection → Load Deitrix/Holotape → Transfer Control

1.3 Memory Layout

0x00000000 - 0x00000FFF : Exception Vectors (4KB)
0x00001000 - 0x00007FFF : PIP-OS Kernel (28KB)
0x00008000 - 0x0000FFFF : System Services (32KB)
0x00010000 - 0x0001FFFF : ROM Space (Deitrix) (64KB)
0x00020000 - 0x0002FFFF : Application Space (64KB)
0x00030000 - 0x0003FFFF : Graphics Buffer (64KB)
0x00040000 - [RAM_END]  : User Space

2. Boot Sequence Implementation

2.1 Matrix-Style Startup Display

  • Character Set: Mix of alphanumeric and special characters
  • Animation Pattern:
    • Vertical cascading (Matrix-like)
    • Random character changes
    • Gradual fade effect
    • Duration: 3-5 seconds
  • Color Scheme: Green phosphor with varying intensities
  • Resolution: Adapts to display (minimum 320x240)

2.2 Audio Sequence

  • Boot Sound Profile:
    • Initial power-on beep (440Hz, 200ms)
    • Data stream noise (white noise modulated)
    • Mechanical relay clicks
    • Final ready chime (C-E-G chord)
  • Audio Output: PWM through GPIO or I2S DAC
  • Volume Control: Hardware-dependent

2.3 Boot Messages

LOADER V1.1
EXEC VERSION 41.10
64K RAM SYSTEM
38911 BYTES FREE
NO HOLOTAPE FOUND
LOAD ROM(1): DEITRIX 303

3. Hardware Abstraction Layer

3.1 Display Support

  • Primary Displays:
    • SPI TFT (ILI9341, ST7789) - 320x240 minimum
    • HDMI output for development
    • Composite video for authentic CRT displays
  • Display Modes:
    • Vector graphics mode (lines and points)
    • Bitmap mode (for images)
    • Text mode (terminal fallback)
  • Refresh Rate: 30 FPS minimum, 60 FPS target

3.2 Input Devices

  • Physical Controls:
    • Rotary encoder for dial navigation
    • 5 minimum buttons (up, down, left, right, select)
    • Optional: Touch overlay support
  • GPIO Mapping: Configurable per hardware variant
  • Debouncing: Hardware and software debouncing

3.3 Sensor Integration

  • Required Sensors:
    • Real-time clock (RTC)
    • Battery voltage monitor
  • Optional Sensors:
    • Geiger counter (radiation detection)
    • GPS module (location tracking)
    • Accelerometer (motion detection)
    • Temperature sensor
    • Heart rate monitor (biometric seal simulation)
  • Sensor Interface: I2C/SPI with automatic detection

3.4 Au...


💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

Copilot AI and others added 4 commits November 9, 2025 22:13
Co-authored-by: jbltx <1284323+jbltx@users.noreply.github.com>
…, and syscall interface

Co-authored-by: jbltx <1284323+jbltx@users.noreply.github.com>
…ment guide, and improved .gitignore

Co-authored-by: jbltx <1284323+jbltx@users.noreply.github.com>
…calls, and hardware abstraction

Co-authored-by: jbltx <1284323+jbltx@users.noreply.github.com>
Copilot AI changed the title [WIP] Implement complete rewrite of repository for PIP-OS Implement PIP-OS V7.1.0.8: Complete rewrite with ROM loading, system calls, and hardware abstraction Nov 9, 2025
Copilot AI requested a review from jbltx November 9, 2025 22:32
@jbltx
Copy link
Contributor

jbltx commented Nov 9, 2025

@copilot Does this implementation support USB mass storage (holotape custom driver) ?

Copy link
Contributor Author

Copilot AI commented Nov 9, 2025

@copilot Does this implementation support USB mass storage (holotape custom driver) ?

No, USB mass storage for holotape detection is not currently implemented. The holotape_detect() function in src/kernel/rom_loader.c (lines 101-108) is a stub that returns false.

The code includes comments indicating where USB mass storage checking should be added:

// In a real implementation, this would:
// - Check USB mass storage
// - Check SD card hot-swap
// - Check custom holotape reader

To add USB mass storage support, you would need to:

  1. Implement a USB host controller driver (DWCOTG for BCM2835/36/37)
  2. Add USB mass storage class driver
  3. Implement FAT filesystem support to read holotape files
  4. Update holotape_detect() to enumerate USB devices and look for holotape headers

This is noted as future work in CONTRIBUTING.md under "Low Priority" → "USB support".

@jbltx jbltx marked this pull request as ready for review November 9, 2025 22:49
@jbltx
Copy link
Contributor

jbltx commented Nov 10, 2025

Co-authored-by: jbltx <1284323+jbltx@users.noreply.github.com>
Copy link
Contributor Author

Copilot AI commented Nov 10, 2025

@copilot Can we add a GHA to build and test the project?
Something similar to what we did in RETROS-BIOS:

Added complete GitHub Actions CI/CD workflow in commit 9c73055. The implementation includes:

GitHub Actions (.github/workflows/ci.yml):

  • Build and test job: Builds for BCM2835/2836/2837, runs unit and integration tests
  • Static analysis job: Checks formatting, TODO/FIXME, header guards
  • Documentation check job: Validates all docs exist

Test Suite (tests/):

  • run_tests.sh: Integration tests (build verification, file presence, binary size)
  • test_memory.py: Unit tests for k_strlen, k_memcmp, k_memcpy, memset
  • README.md: Complete test documentation

Test Results: All 9 tests passing ✓

  • BCM2835 build: 40000 bytes
  • BCM2836 build: 40032 bytes
  • All source/header files present
  • Binary size within 100KB limit

Also fixed:

  • Makefile libgcc path
  • ARMv6 compatibility (WFI/WFE instructions on BCM2835)

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • esm.ubuntu.com
    • Triggering command: /usr/lib/apt/methods/https (dns block)

If you need me to access, download, or install something from one of these locations, you can either:

Copilot AI changed the title Implement PIP-OS V7.1.0.8: Complete rewrite with ROM loading, system calls, and hardware abstraction Implement PIP-OS V7.1.0.8: Complete rewrite with ROM loading, system calls, hardware abstraction, and CI/CD Nov 10, 2025
Copilot AI requested a review from jbltx November 10, 2025 04:47
@jbltx jbltx merged commit cae4582 into master Nov 10, 2025
3 checks passed
@jbltx jbltx deleted the copilot/rewrite-repository-for-pip-os branch November 10, 2025 04:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants